from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

driver = webdriver.Edge()
driver.get('https://mail.qq.com/')
driver.maximize_window()
sleep(2)
# 进入frame框架
driver.switch_to.frame(driver.find_element(By.XPATH,'/html/body/div[1]/div[2]/div[3]/div[1]/div/div[2]/div[2]/iframe'))
sleep(1)
driver.switch_to.frame(driver.find_element(By.XPATH,'//*[@id="ptlogin_iframe"]'))
# 点击qq头像登录
driver.find_element(By.ID,'img_out_1847537889').click()

sleep(10)